package com.freespace.controll;

import com.freespace.anno.RpcReference;
import com.freespace.pojo.Product;
import com.freespace.service.IProductService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 商品接口类
 * @author qq2946937384
 */
@RestController
@RequestMapping("/product")
public class ProductController {

    @RpcReference
    IProductService userService;

    @GetMapping("/{id}")
    public Product getUserById(@PathVariable("id") int id) {
        return userService.getById(id);
    }
}
